<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="keywords" content="">
<meta name="description" content="">
<title>YaptestFE</title>
<%= stylesheet_link_tag "reset-fonts-grids", :media => "all" %>
<%= stylesheet_link_tag "base", :media => "all" %>
<%= stylesheet_link_tag "redandblack", :media => "all" %>
<%= stylesheet_link_tag "menus", :media => "all" %>
<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
   {
   if(mySel.form.target)myWin = parent[mySel.form.target];
   else myWin = window;
   if (! myWin) return true;
   myWin.location = myVal;
   }
return false;
}
//-->
</SCRIPT>

</head>
<body>
<%= javascript_include_tag "wz_tooltip" %>
<div id="doc3" class="yui-t1">
  <div id="hd">
    <!-- PUT MASTHEAD CODE HERE -->

<table border=0 class="headertab">
  <tr>
    <td width=30>
       <img src="/images/yaptest.png">
    </td>
    <td width=200>
<table border=0 class="headertab">
    <td width=300 style="text-align: right">
<FORM 
     METHOD=POST onChange="return dropdown(this.gourl)">

Currently showing results from

 <% if not session[:test_area].nil? %>
  Test Area
 <% end %>

<SELECT NAME="gourl" STYLE="background-color: white; border: 1px solid #ccc">

 <% if session[:test_area].nil? %>
  <OPTION SELECTED VALUE="/test_areas/set/all">All Test Areas
 <% else %>
  <OPTION VALUE="/test_areas/set/all">All Test Areas
 <% end %>

<% 
@ta = TestArea.find(:all, :order => "name")
for ta in @ta
%>

<% if ta.id == session[:test_area] %>
  <OPTION SELECTED VALUE="/test_areas/set/<%=h ta.id %>"><%=h ta.name %>
<% else %>
  <OPTION VALUE="/test_areas/set/<%=h ta.id %>"><%=h ta.name %>
<% end %>

<% end %>


</SELECT>
       in Test Database 
       <% if ENV['YAPTESTFE_DBNAME'].nil? %>
		BUG!
       <% else %>
		<%=h ENV['YAPTESTFE_DBNAME'] %>
       <% end %>

</FORM>
<h1><%=h @page_title %></h1>
    </td>
  </tr>
    <tr>
    <td>
<% if not @host_menu.nil? %>
<%
  if session[:test_area].nil?
    @next_host = Host.find(:first, :conditions => ["ip_address > ?", @host.ip_address], :limit => 1, :order => 'ip_address')
    @prev_host = Host.find(:first, :conditions => ["ip_address < ?", @host.ip_address], :limit => 1, :order => 'ip_address DESC')
  else
    @next_host = Host.find_by_test_area_id(session[:test_area], :conditions => ["ip_address > ?", @host.ip_address], :limit => 1, :order => 'ip_address')
    @prev_host = Host.find_by_test_area_id(session[:test_area], :conditions => ["ip_address < ?", @host.ip_address], :limit => 1, :order => 'ip_address DESC')
  end
  %>
<div id="tabsJ">
    <% if ! @prev_host.nil? %>
    <%
	url_opts2 = {}
        if  not @select_openvas.nil?
                url_opts2[:controller] = "hosts"
                url_opts2[:action] = @action
                url_opts2[:id] = @prev_host.id
        end
        if  not @select_nessus.nil?
                url_opts2[:controller] = "hosts"
                url_opts2[:action] = @action
                url_opts2[:id] = @prev_host.id
        end
        if  not @select_issues.nil?
                url_opts2[:controller] = "issues"
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_portinfo.nil?
                url_opts2[:controller] = "port_infos"
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_nmapinfo.nil?
                url_opts2[:controller] = "nmap_infos"
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_insecprotos.nil?
                url_opts2[:controller] = "insecure_protocols"
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_icmp.nil?
                url_opts2[:controller] = "icmps"
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_creds.nil?
                url_opts2[:controller] = "credentials" # broken
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_groups.nil?
                url_opts2[:controller] = "groups" # broken
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_passwordhashes.nil?
                url_opts2[:controller] = "password_hashs" # broken
                url_opts2[:host_id_v] = @prev_host.id
        end
        if  not @select_hostinfo.nil?
                url_opts2[:controller] = "host_infos" # broken
                url_opts2[:host_id_v] = @prev_host.id
        end
    %>
    <%= link_to image_tag("resultset_previous.png", :align => 'absmiddle', :onmouseover => "Tip('Previous Host: #{@prev_host.ip_address}')", :onmouseout => "UnTip()"), url_opts2 ,{ :class => 'arrow'} %>
    <% end %>
  <ul>
    <li<% if not @select_hostinfo.nil? %> class="selected" <% end %>><a href="/hosts/showhostinfo/<%=h @host.host_id %>"><span>Host Info</span></a><a href="#" title="Link 2"></li>
    <li<% if not @select_icmp.nil? %> class="selected" <% end %>><a href="/icmps?host_id_v=<%=h @host.host_id %>"><span>ICMP</span></a><a href="#" title="Link 2"></li>
    <li<% if not @select_nmapinfo.nil? %> class="selected" <% end %>><a href="/nmap_infos?host_id_v=<%=h @host.host_id %>"><span>Ports</span></a></li>
    <li<% if not @select_portinfo.nil? %> class="selected" <% end %>><a href="/port_infos?host_id_v=<%=h @host.host_id %>"><span>Port_info</span></a></li>

    <li<% if not @select_insecprotos.nil? %> class="selected" <% end %>><a href="/insecure_protocols?host_id_v=<%=h @host.host_id %>"><span>Insec Protos</span></a></li>
    <li<% if not @select_creds.nil? %> class="selected" <% end %>><a href="/hosts/showcreds/<%=h @host.host_id %>"><span>Credentials</span></a></li>
    <li<% if not @select_groups.nil? %> class="selected" <% end %>><a href="/hosts/showgroups/<%=h @host.host_id %>"><span>Groups</span></a></li>
    <li<% if not @select_passwordhashes.nil? %> class="selected" <% end %>><a href="/hosts/showpasswordhashes/<%=h @host.host_id %>"><span>Hashes</span></a></li>
    <li<% if not @select_nessus.nil? %> class="selected" <% end %>><a href="/hosts/shownessus/<%=h @host.host_id %>"><span>Nessus</span></a></li>
    <li<% if not @select_openvas.nil? %> class="selected" <% end %>><a href="/hosts/showopenvas/<%=h @host.host_id %>"><span>OpenVAS</span></a></li>
    <li<% if not @select_issues.nil? %> class="selected" <% end %>><a href="/issues?host_id_v=<%=h @host.host_id %>"><span>Issues</span></a></li>
    <%
    if ! @next_host.nil?
	url_opts = {}
        if  not @select_openvas.nil?
                url_opts[:controller] = "hosts"
                url_opts[:action] = @action
                url_opts[:id] = @next_host.id
        end
        if  not @select_nessus.nil?
                url_opts[:controller] = "hosts"
                url_opts[:action] = @action
                url_opts[:id] = @next_host.id
        end
        if  not @select_issues.nil?
                url_opts[:controller] = "issues"
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_portinfo.nil?
                url_opts[:controller] = "port_infos"
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_nmapinfo.nil?
                url_opts[:controller] = "nmap_infos"
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_insecprotos.nil?
                url_opts[:controller] = "insecure_protocols"
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_icmp.nil?
                url_opts[:controller] = "icmps"
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_creds.nil?
                url_opts[:controller] = "credentials" # broken
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_groups.nil?
                url_opts[:controller] = "groups" # broken
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_passwordhashes.nil?
                url_opts[:controller] = "password_hashs" # broken
                url_opts[:host_id_v] = @next_host.id
        end
        if  not @select_hostinfo.nil?
                url_opts[:controller] = "host_infos" # broken
                url_opts[:host_id_v] = @next_host.id
        end
    %>
    <li><%= link_to image_tag("resultset_next.png", :align => 'absmiddle', :onmouseover => "Tip('Next Host: #{@next_host.ip_address}')", :onmouseout => "UnTip()"), url_opts, { :class => 'arrow' } %></li>
    <% end %>
  </ul>
<% end %>

</div>
    </td>
    </tr>
</table>
</table>

  </div>
  <div id="bd">
    <div id="yui-main">
      <div class="yui-b">
        <!-- PUT MAIN COLUMN CODE HERE -->

<%= @content_for_layout %>


<%= render :partial => 'layouts/tablen' %>
      </div>
    </div>
    <div class="yui-b">
      <!-- PUT SECONDARY COLUMN CODE HERE -->

<div id="menu8">
		<ul>
			<li<% if not @mselect_testareas.nil? %> class="selected" <% end %>><%= link_to 'Test Areas', :controller => 'Test_areas', :action => 'index' %></li>
		</ul>
</div>

<div id="menu8">
		<ul>
			<li<% if not @mselect_netmap.nil? %> class="selected" <% end %>><%= link_to 'Network Map', :controller => 'topologys', :action => 'index' %></li>
		</ul>
</div>

<div id="menu8">
		<ul>
			<li<% if not @mselect_hosts.nil? %> class="selected" <% end %>><%= link_to 'Hosts', :controller => 'Hosts', :action => 'index' %></li>
			<li<% if not @mselect_hostinfo.nil? %> class="selected" <% end %>><%= link_to 'Host Info', :controller => 'Host_infos', :action => 'index' %></li>
			<li<% if not @mselect_windowshostinfo.nil? %> class="selected" <% end %>><%= link_to 'Windows Info', :controller => 'Windows_Host_infos', :action => 'index' %></li>
			<li<% if not @mselect_icmp.nil? %> class="selected" <% end %>><%= link_to 'ICMP', :controller => 'Icmps', :action => 'index' %></li>
			<li<% if not @mselect_macs.nil? %> class="selected" <% end %>><%= link_to 'MAC Addresses', :controller => 'Hosts_to_Mac_addresses', :action => 'index' %></li>
		</ul>
</div>

<div id="menu8">
		<ul>
			<li<% if not @mselect_nmapinfo.nil? %> class="selected" <% end %>><%= link_to 'Ports', :controller => 'Nmap_infos', :action => 'index' %></li>
			<li<% if not @mselect_portinfo.nil? %> class="selected" <% end %>><%= link_to 'Ports Info', :controller => 'Port_infos', :action => 'index' %></li>
			<li<% if not @mselect_portsummary.nil? %> class="selected" <% end %>><%= link_to 'Port Summary', :controller => 'Port_summarys', :action => 'index' %></li>
			<li<% if not @mselect_insecprotos.nil? %> class="selected" <% end %>><%= link_to 'Insecure Protos', :controller => 'Insecure_protocols', :action => 'index' %></li>
		</ul>
</div>
<div id="menu8">
		<ul>
			<li<% if not @mselect_creds.nil? %> class="selected" <% end %>><%= link_to 'Credentials', :controller => 'Credentials', :action => 'index' %></li>
			<li<% if not @mselect_groups.nil? %> class="selected" <% end %>><%= link_to 'Groups', :controller => 'Groups', :action => 'index' %></li>
			<li<% if not @mselect_hashes.nil? %> class="selected" <% end %>><%= link_to 'Passwd Hashes', :controller => 'Password_hashs', :action => 'index' %></li>
		</ul>
</div>
<div id="menu8">
		<ul>
			<li<% if not @mselect_issues.nil? %> class="selected" <% end %>><%= link_to 'Issues', :controller => 'Issues', :action => 'index' %></li>
		</ul>
</div>
<div id="menu8">
		<ul>
			<li<% if not @mselect_help.nil? %> class="selected" <% end %>><%= link_to 'Help', :controller => 'Help' %></li>
			<li<% if not @mselect_about.nil? %> class="selected" <% end %>><%= link_to 'About', :controller => 'Help', :action => 'about' %></li>
		</ul>
</div>
    </div>
  </div>
  <div id="ft">
    <!-- PUT FOOTER CODE HERE -->
  </div>
</div>
</body>
</html>
